<template>
  <el-carousel :interval="4000" type="card" height="270px"  v-loading="loading" >
    <el-carousel-item class="item" v-for="item in imglist" :key="item">
     <router-link :to="{path:'/book',query:{id:item.flBook.isbn}}">
      <el-image
        referrer="no-referrer|origin|unsafe-url"
          style="width: 509px; height: 270px;"
         :src="'https://images.weserv.nl/?url=' + item.topImg"
          fit="fill"></el-image>
     </router-link>
    </el-carousel-item>
  </el-carousel>
</template>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 50px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
 
</style>
<<script>
import axios from "axios";

export default {
  data() {
    return {
        imglist:[],
        loading:true,
    }
  },
  methods:{
    getlunbo(){
       axios
        .get("http://localhost:8081/fl-book/shufflingFigure", {
          params: {
           
          },
        })
        .then((res) => {
          console.log(res.data);
          console.log("sdds");
          this.imglist = res.data.data;
          this.loading=false;
        });
    }
  }, 
  created() {
    this.getlunbo();
  }
}
</script>